<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">

<head th:fragment="header">
  <meta charset="UTF-8">
  <title>IDPRAVUS</title>
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css">
  <link rel="stylesheet" href="//cdn.rawgit.com/hiun/NanumSquare/master/nanumsquare.css">
  <link rel="stylesheet" href="/css/trumbowyg.css">
  <link rel="stylesheet" href="/css/style.css">
</head>

<body>

<nav th:fragment="navi" class="teal">
  <div class="nav-wrapper container teal">
    <a href="/" class="brand-logo">IDPRAVUS</a>
    <ul id="nav-mobile" class="right hide-on-med-and-down">
      <li><a href="/board">게시판</a></li>
      <li><a href="/user">회원 목록</a></li>
      <th:block sec:authorize="isAnonymous()">
        <li><a href="/signup">회원 가입</a></li>
        <li><a href="/login">로그인</a></li>
      </th:block>
      <th:block sec:authorize="isAuthenticated()">
        <form id="logout" class="inline" method="post" th:action="|/logout?${_csrf.parameterName}=${_csrf.token}|">
          <input type="hidden" id="auth" th:value="${#authentication.principal.id}">
          <li><a th:href="|/user/${#authentication.principal.id}|">정보수정</a></li>
          <li><a href="javascript:logout()">로그아웃</a></li>
        </form>
      </th:block>
    </ul>
  </div>
</nav>

<div th:fragment="footer">
  <script src="/js/script.js"></script>
  <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script>
</div>

</body>

</html>
